/** 
* This class is Apex scheduler class and is used to kick in the 
* SPA Util Class which does miscellaneous cleanup job
*
* Client - Cisco Systems (Linksys)
* 
* Author - Manu Dhingra
* Created Date - Feb 2010
* Last Update Date- Feb 2010
* 
**/

global class accountAssignmentScheduler implements Schedulable{
	public static String CRON_EXP = '0 0 0 3 9 ? 2022';
	
            global void execute(SchedulableContext SC) {
                accountAssignmentProcess.assignmentRules();             
                system.debug ('Setting an Apex batch job');
            }
//test method
   @isTest
static void test() {
            Test.startTest();
				String jobId = System.schedule('testBasicScheduledApex', 
				accountAssignmentScheduler.CRON_EXP, new accountAssignmentScheduler());
				
				CronTrigger ct = [SELECT id, CronExpression, TimesTriggered, NextFireTime
				FROM CronTrigger WHERE id = :jobId];
				// Verify the expressions are the same        
				
				System.assertEquals(accountAssignmentScheduler.CRON_EXP, ct.CronExpression);
				// Verify the job has not run  
				    
				System.assertEquals(0, ct.TimesTriggered);
				// Verify the next time the job will run  
				    
				System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
			Test.stopTest();      
            }    

}